//
//  SLAddLockListCell.m
//  SlockApp
//
//  Created by 凯朱 on 2024/7/16.
//

#import "SLAddLockListCell.h"

@implementation SLAddLockListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    _bgView.layer.cornerRadius = 20;
    _bgView.layer.masksToBounds = YES;
    _bgView.layer.borderColor = kHexColor(@"#404040").CGColor;
    _bgView.layer.borderWidth = 1;
    
    
}

-(void)setModel:(SLLockModel *)model{
    _model = model;
//    _nameLbl.text = kReplace(@"Padlock G1", model.deviceName);
    _nameLbl.text = kReplace(@"Padlock G1", model.deviceName);
//    NSString *desc = [NSString stringWithFormat:@"%@",kReplace(model.productName, kLocalString(@"Unknown type"))];
    NSString *desc = [NSString stringWithFormat:@"%@",model.deviceNo.stringToHex];  // 设备编码的16进制
//    if ([ZCTool isOpenDebugModel]) {
//        desc = [NSString stringWithFormat:@"%@（%@-%@绑定）",kReplace(model.productName, kLocalString(@"Unknown type")),model.deviceNo,model.isBind?@"已":@"未"];
//    }
    _descLbl.text = desc;
    if ([_model.deviceCategory isEqualToString:@"1"]) {
        _icon.image = [UIImage imageNamed:@"icon_lock_detail"];
        _wifiIconWidth.constant = 0;
        _wifiIcon.hidden = YES;
    }else{
        _icon.image = [UIImage imageNamed:@"icon_bridge_small"];
        _wifiIconWidth.constant = 22;
        _wifiIcon.hidden = NO;
    }
}

@end
